﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kristall;
using Kristall.Managers;

namespace Kristall.Engine
{
    public abstract class Weapon  : Animatable
    {

        public virtual float CoolDownTime { get; set; }
        public float Range { get; set; }

        public Weapon()
        {
            OnCollision += new EventHandler<CollisionEventArgs>(Weapon_OnCollision);

        }

        void Weapon_OnCollision(object sender, CollisionEventArgs e)
        {
            if (e.Other is Player)
            {
                Level.Player.CurrentWeapon = this;
                this.RemoveFromLevel();
                Kristall.SoundManager.PlayNonInstancedSound("EquipWeapon");
            }
        }       

        public abstract void Fire();
        public abstract void HandleInput(InputState inputState);
        public abstract void UpdateWeapon(float dt);        
    }
}
